<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"><?=$this->translate('选择商品')?></h4>
    </div>
    <div class="modal-body box-body table-responsive no-padding">
        <table class="table table-hover">
            <thead>
            <tr>
                <td colspan="5">
                    <div class="col-xs-12 form-group">
                        <div class="col-sm-8">
                            <input type="text" name="searchGoodsName" id="searchGoodsName" class="form-control input-sm" placeholder="<?=$this->translate('输入全部或部分商品名称')?>" value="<?=$this->searchGoodsName;?>">
                        </div>
                        <div>
                            <button type="button" class="btn btn-primary btn-sm" onclick="searchGoods();"><?=$this->translate('搜索')?></button>
                        </div>
                    </div>

                </td>
            </tr>
            <tr>
                <th width="2%"></th>
                <th width="15%"><?=$this->translate('商品编号')?></th>
                <th><?=$this->translate('商品名称')?></th>
                <th><?=$this->translate('商品规格')?></th>
                <th width="10%"><?=$this->translate('操作')?></th>
            </tr>
            </thead>
            <tbody>
            <?php if($this->goodsList) foreach ($this->goodsList as $goods) { ?>
                <tr>
                    <td><input  name="selectGoodsId[]" value="<?=$goods->getGoodsId()?>" type="checkbox" class="minimal"></td>
                    <td><?= $this->escapeHtml($goods->getGoodsNumber())?></td>
                    <td><?=$this->escapeHtml($goods->getGoodsName())?></td>
                    <td><?= empty($goods->getGoodsSpec()) ? $this->translate('无') : $this->escapeHtml($goods->getGoodsSpec())?></td>
                    <td><button type="button" class="btn btn-primary btn-sm" onclick="addSelectGoods(<?=$goods->getGoodsId()?>);"><?=$this->translate('点击添加')?></button></td>
                </tr>
            <?php } ?>
            </tbody>
            <tfoot>
                <tr>
                    <td colspan="5">
                        <?=$this->paginationControl($this->goodsList,
                            'Sliding',
                            'layout/ajaxPage',
                            ['route' => 'goods', 'params' => ['action' => 'ajaxGoodsSearch'], 'showDivId' => 'addGoodsListBody']); ?>
                    </td>
                </tr>
            </tfoot>

        </table>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm" onclick="addMoreSelectGoods();"><?=$this->translate('选择商品添加')?></button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal"><?=$this->translate('关闭')?></button>
    </div>
</div>